package BranchBound;

public class OptimalSchedulingTest {
    public static void main(String[] args) {
        int tasks = 7, machines = 4;
        int[] taskTimes = new int[]{2, 14, 4, 16, 6, 5, 3};
        OptimalScheduling optimalScheduling = new OptimalScheduling(tasks, machines,taskTimes);
        optimalScheduling.backtrack(0);

        System.out.println("最佳时间:" + optimalScheduling.getBest());

        System.out.println("每个任务耗时:");
        for (int i = 0; i < tasks; i++)
            System.out.print(taskTimes[i] + "  ");
        System.out.println();

        int[] bestSolution = optimalScheduling.getBestSolution();
        System.out.println("最好的分配方法:");
        for (int i = 0; i < tasks; i++)
            System.out.print(bestSolution[i] + "  ");
    }
}
